/*
 * @(#)SearchResult.java 0.0.1-SNAPSHOT
 *
 * Copyright Group B
 */

package grupb.upf.ms.impl;

import grupb.upf.ms.DescriptionContent;
import java.io.Serializable;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * <p>This component implements the SearchResult interface. It cointains the
 * content of a SearchResult message.</p>
 *
 *
 * @version    0.0.1-SNAPSHOT
 * @author     Group B
 */
public final class SearchResult implements grupb.upf.ms.SearchResult,
        Serializable {

    /**
     * The logger. A new logger <code>grupb.upf.ms.SearchResult</code> is
     * created to add the logs of this SearchResult.
     */
    private static final Log LOG = LogFactory.getLog(SearchResult.class);
    /**
     * The serialVersionUID is created to be able to serialize this class, it's
     * necessary because it will be sent.
     */
    private static final long serialVersionUID = 1L;
    /**
     * The description of the searched object.
     */
    private DescriptionContent desContent;
    /**
     * Constructor of the class.
     * @param descriptionContent the description of the searched object
     */
    public SearchResult(final DescriptionContent descriptionContent) {
        this.desContent = descriptionContent;
    }

    /**
     * This method allows us to set up the propierties of a search response.
     * @param descriptionContent the properties of the content
     */
    @Override
    public void setSearchResult(final DescriptionContent descriptionContent) {
        this.desContent = descriptionContent;
    }

    /**
     * This method allows us to recover the info of a SearchResult message that
     * we have receive from another user.
     * @return the description of the searched content
     */
    @Override
    public DescriptionContent getSearchResult() {
        return this.desContent;
    }
}
